<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        window.onload=a;
        function a(){
            alert("确定要打开本网页吗？");
            //提取input标签
           var eleInput= document.getElementsByTagName("input");
           //设置第四个input点击触发事件
           eleInput[3].onclick=function(){
               //获取半径
            var r=eleInput[0].value;
            eleInput[1].value=2*Math.PI*r;
            eleInput[2].value=Math.PI*Math.pow(r,2);
           }

           eleInput[4].ondblclick = function(){
            eleInput[0].value="";
            eleInput[1].value="";
            eleInput[2].value="";

           }
        }
    </script>
</head>
<body>
    <h2>求周长和面积圆的</h2>
    <form>
        半径<input type="text" placeholder="请输入圆的半径值"><br>
        周长<input type="text" ><br>
        面积<input type="text" ><br>
        <input type="button" value="确定">
        <input type="button" value="重置">
        
    </form>
</body>
</html>